<script lang="ts" setup>
import { useSlots, ref } from 'vue'
import { createExposeProxy } from '@/utils/exposeProxy'
const onFailed = (errorInfo:any) => {
      showToast(errorInfo.errors[0].message)
};

const formRef = ref();
const slots = useSlots();

//代理实例方法
defineExpose(
  createExposeProxy({},formRef)
);

</script>

<template>
    <van-form :show-error-message="false" @failed="onFailed" ref="formRef" validate-trigger="onBlur">
        <template v-for="(value, name) in slots" #[name]="scope">
            <slot :name="name" v-bind="scope || {}"></slot>
        </template>
    </van-form>
</template>

<style lang="scss" scoped>
</style>
